From 6b94002c0c85114b9987e66985eb477d20ff15ba Mon Sep 17 00:00:00 2001 From: Marco Leogrande Date: Wed, 21 Jun 2017 22:35:03 -0700 Subject: [PATCH] garmin_fit: bugfix in switch logic The logic for global ID 19 was incorrectly nested under the logic for global ID 20. Fix the issue by making the two case labels correct siblings in the same switch statement. --- garmin_fit.cc | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/garmin_fit.cc b/garmin_fit.cc index 65e9878bc..9d7db66f0 100644 --- a/garmin_fit.cc +++ b/garmin_fit.cc @@ -411,6 +411,15 @@ fit_parse_data(fit_message_def* def, int time_offset) } temperature = val; break; + default: + if (global_opts.debug_level >= 1) { + debug_print(1, "%s: unrecognized data type in GARMIN FIT record: f->id=%d\n", MYNAME, f->id); + } + break; + } // switch (f->id) + // end of case def->global_id = 20 + break; + case 19: // lap wptType , endlat+lon is wpt switch (f->id) { case 2: @@ -461,14 +470,15 @@ fit_parse_data(fit_message_def* def, int time_offset) } break; } // switch (f->id) + // end of case def->global_id = 19 break; - default: - if (global_opts.debug_level >= 1) { - debug_print(1, "%s: unrecognized data type in GARMIN FIT record: f->id=%d\n", MYNAME, f->id); - } - break; + + default: + if (global_opts.debug_level >= 1) { + debug_print(1, "%s: unrecognized/unhandled global ID for GARMIN FIT: %d\n", MYNAME, def->global_id); } - } + break; + } // switch (def->global_id) } } -- 2.30.2